package com.noahplat.user.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.util.Date;

/**
 * 头像实体类
 *
 * @author 李东
 * @version 1.0.0
 * @Date: 2021/3/13 9:23
 **/
@Table(name = "tb_avatar")
@Data
public class Avatar {

    @Id
    private Long id;

    @NotEmpty(message = "标题不能为空")
    private String title; //标题

    @NotEmpty(message = "图片不能为空")
    private String image; //图片路由

    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime; //创建时间

    @Min(value = 1, message = "系统类型不能为空")
    private Long stid;

    @Transient
    private String sysname;   //系统名称
}
